O = 10;
N = 2^O-1;
pattern1 = prbs(O,N);
y=fft(pattern1);
f = (1:length(y));
% plot(f,abs(y));
subplot(2,1,1);
plot(f,y);
t = 0:N;
x = square(t)/2+0.5;
z=fft(x);
f = (1:length(x));
subplot(2,1,2);
plot(f,z);

subplot(2,1,1);
figure,imshow(z);title('方波傅立叶');
subplot(2,1,2);
figure,imshow(y);title('随机码傅立叶');
